﻿Public Class ArrayButtons
    Dim filas As Integer = 6
    Dim butacas As Integer = 15
    Dim b(filas, butacas) As ValueButton
    Dim pos(filas, butacas) As Integer
    Dim tamanyo As Integer = 40
    Dim posX As Integer = 0
    Dim posY As Integer = 0

    Private Sub ArrayButtons_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        For i As Integer = 0 To filas - 1

            For i2 As Integer = 0 To butacas - 1
                b(i, i2) = New ValueButton
                b(i, i2).FlatStyle = FlatStyle.Flat
                b(i, i2).Height = tamanyo
                b(i, i2).Width = tamanyo
                b(i, i2).Text = i2
                b(i, i2).Location = New Point(posX, posY)
                posX = posX + tamanyo
                Me.Controls.Add(b(i, i2))
            Next

            posY = posY + tamanyo
            posX = 0
        Next
    End Sub

    Public Sub iniciaArray()
        For i As Integer = 0 To filas - 1

            For i2 As Integer = 0 To butacas - 1
                pos(i, i2) = 0
            Next

        Next

        For i As Integer = 0 To filas - 1

            For i2 As Integer = 0 To butacas - 1
                If pos(i, i2) = 0 Then b(i, i2).BackColor = Color.Green
            Next

        Next
    End Sub
End Class
